package com.telit.firecommand;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.github.xiaolyuh.cache.config.EnableLayeringCache;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;


@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.telit.**.feign"})
@MapperScan({"com.telit.**.dao"})
@ComponentScan(basePackages = {"com.telit.firecommand", "com.telit.common"})
@EnableScheduling
@EnableLayeringCache
@Import(com.telit.common.cache.RedisConfig.class)
public class FireCommandApplication9012 {

    public static void main(String[] args) {
        SpringApplication.run(FireCommandApplication9012.class, args);
    }

    /**
     * mp分页插件
     *
     * @return
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.POSTGRE_SQL));
        return interceptor;
    }

}

